package com.youmeek.ssm.module.area.model;

import com.youmeek.ssm.basic.core.model.BaseValueObject;

public class ChinaArea extends BaseValueObject implements Comparable<ChinaArea> {

    /**
     * @fields serialVersionUID :
     */
    private static final long serialVersionUID = 1L;

    /**
     * 地区编码
     */
    private Integer areaCode;

    private String chinaAreaId;

    /**
     * 地区名称
     */
    private String areaName;

    /**
     * 父id
     */
    private Integer parentId;

    /**
     * 简称
     */
    private String shortName;

    /**
     * 邮政编码
     */
    private Integer zipCode;

    /**
     * 汉语拼音
     */
    private String pinYin;

    /**
     * 经度
     */
    private String longitude;

    /**
     * 纬度
     */
    private String latitude;

    /**
     * 等级
     */
    private int areaLevel;

    /**
     * 地理位置
     */
    private String position;

    /**
     * 排序
     */
    private int sort;

    /**
     * 税收地区编码
     */
    private String taxTemplateAreaCode;

    /**
     * 是否是试点地区
     */
    private String pilotAreaed;

    public Integer getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(Integer areaCode) {
        this.areaCode = areaCode;
    }

    public String getChinaAreaId() {
        return chinaAreaId;
    }

    public void setChinaAreaId(String chinaAreaId) {
        this.chinaAreaId = chinaAreaId == null ? null : chinaAreaId.trim();
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName == null ? null : areaName.trim();
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName == null ? null : shortName.trim();
    }

    public Integer getZipCode() {
        return zipCode;
    }

    public void setZipCode(Integer zipCode) {
        this.zipCode = zipCode;
    }

    public String getPinYin() {
        return pinYin;
    }

    public void setPinYin(String pinYin) {
        this.pinYin = pinYin == null ? null : pinYin.trim();
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude == null ? null : longitude.trim();
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude == null ? null : latitude.trim();
    }

    public int getAreaLevel() {
        return areaLevel;
    }

    public void setAreaLevel(int areaLevel) {
        this.areaLevel = areaLevel;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position == null ? null : position.trim();
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    public String getTaxTemplateAreaCode() {
        return taxTemplateAreaCode;
    }

    public void setTaxTemplateAreaCode(String taxTemplateAreaCode) {
        this.taxTemplateAreaCode = taxTemplateAreaCode == null ? null : taxTemplateAreaCode.trim();
    }

    public String getPilotAreaed() {
        return pilotAreaed;
    }

    public void setPilotAreaed(String pilotAreaed) {
        this.pilotAreaed = pilotAreaed == null ? null : pilotAreaed.trim();
    }

    private static final ChinaArea CHINA = new ChinaArea(){
        {
            setAreaCode(0);
            setAreaName("中国");
            setParentId(null);
        }
    };

    public static ChinaArea topChinaArea(){
        return CHINA;
    }

    /**
     * 地区的比较
     * @param o
     * @return
     */
    @Override
    public int compareTo(ChinaArea o) {
        return areaCode.compareTo(o.areaCode);
    }

    @Override
    public String toString() {
        return "ChinaArea{" +
                "areaCode=" + areaCode +
                ", chinaAreaId='" + chinaAreaId + '\'' +
                ", areaName='" + areaName + '\'' +
                ", parentId=" + parentId +
                ", shortName='" + shortName + '\'' +
                '}';
    }
}